<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            id: 1,
            pname: '小米',
            price: 1999
        };

        // // obj.defineproperty("对象","属性",{需要修改的值})
        // Object.defineproperty(obj, 'id', {
        //     value: 2
        // })

        Object.defineProperty(obj, 'num', {
            value: 1000,

        });


        console.log(obj);
    </script>
</body>

</html>